package com.qf.advice;

import org.springframework.aop.ThrowsAdvice;

/**
 * 异常通知
 * 只有代码中发生异常或者报错，才会执行的辅助功能
 * @author fy
 * @version V1.0
 * @Project day41
 * @Package com.qf.advice
 * @Description:
 * @Date 2022/6/6 9:38
 */
public class MyExceptionAdvice implements ThrowsAdvice {

    //异常通知的方法名必须是：afterThrowing
    public void afterThrowing(Exception ex){
        System.out.println("======异常通知，只有发生了异常才会执行的方法ThrowsAdvice=======");
    }
}
